#ifndef __TCPCONNECT_HPP__
#define __TCPCONNECT_HPP__

#include "SocketIO.hpp"
#include "Socket.hpp"
#include "InetAddress.hpp"

namespace wd{

//保存建立连接的客户fd
class TcpConnection{
public:
    TcpConnection(int clientfd);
    string receive();
    void send(const string&);

private:
    struct sockaddr_in getLocalAddr();
    struct sockaddr_in getPeerAddr();


private:
    Socket _sock;
    SocketIO _sockio;
    InetAddress _localAddr;
    InetAddress _peerAddr;
};

}

#endif // __TCPCONNECT_HPP__

